package com.cnap.model.indicator;

import com.cnap.db.entity.IndicatorCasePO;

/**
 * 指标类
 *
 * @author xc
 **/
public class IndicatorInfo {
    /*
    指标用于算法引擎计算
     */
    // key
    private String key;
    // value
    private String value;
    // unit
    private String unit;

    /**
     * key
     *
     * @return key
     */
    public String getKey() {
        return key;
    }

    /**
     * set
     *
     * @param key key
     */
    public void setKey(String key) {
        this.key = key;
    }

    /**
     * get
     *
     * @return value
     */
    public String getValue() {
        return value;
    }

    /**
     * set
     *
     * @param value value
     */
    public void setValue(String value) {
        this.value = value;
    }

    /**
     * unit
     *
     * @return unit
     */
    public String getUnit() {
        return unit;
    }

    /**
     * set
     *
     * @param unit unit
     */
    public void setUnit(String unit) {
        this.unit = unit;
    }

    /**
     * 转换成IndicatorInfo
     *
     * @param indicatorCasePO po
     * @return info
     */
    public static IndicatorInfo toInfo(IndicatorCasePO indicatorCasePO) {
        IndicatorInfo indicatorInfo = new IndicatorInfo();
        indicatorInfo.setKey(indicatorCasePO.getKey());
        indicatorInfo.setUnit(indicatorCasePO.getUnit());
        indicatorInfo.setValue(indicatorCasePO.getValue());
        return indicatorInfo;
    }
}
